package com.hospital.common.config;


import com.hospital.common.handler.PrepareInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * WebMvc配置
 * <br>
 * 主要配置拦截器,后续可以添加其他配置
 * <br>
 * 拦截器: 预处理拦截器
 * @author yhn
 * @version 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    /**
     * 添加预处理拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new PrepareInterceptor())
                .addPathPatterns("/**");
    }
}
